/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author angelquin
 */
@Entity
@Table(name = "con_detallecontable")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ConDetallecontable.findAll", query = "SELECT c FROM ConDetallecontable c"),
    @NamedQuery(name = "ConDetallecontable.findByConCodigoDetcon", query = "SELECT c FROM ConDetallecontable c WHERE c.conCodigoDetcon = :conCodigoDetcon"),
    @NamedQuery(name = "ConDetallecontable.findByConCantidadDetcon", query = "SELECT c FROM ConDetallecontable c WHERE c.conCantidadDetcon = :conCantidadDetcon"),
    @NamedQuery(name = "ConDetallecontable.findByconCodigoCabcon", query = "SELECT c FROM ConDetallecontable c WHERE c.conCodigoCabcon = :cabContable")})
public class ConDetallecontable implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "CON_CODIGO_DETCON")
    private String conCodigoDetcon;
    @Column(name = "CON_CANTIDAD_DETCON")
    private Double conCantidadDetcon;
    @JoinColumn(name = "CON_CODIGO_LUGAPL", referencedColumnName = "CON_CODIGO_LUGAPL")
    @ManyToOne(optional = false)
    private ConLugarAplicacion conCodigoLugapl;
    @JoinColumn(name = "CON_CODIGO_CUE", referencedColumnName = "CON_CODIGO_CUE")
    @ManyToOne(optional = false)
    private ConCuenta conCodigoCue;
    @JoinColumn(name = "CON_CODIGO_CABCON", referencedColumnName = "CON_CODIGO_CABCON")
    @ManyToOne(optional = false)
    private ConCabeceracontable conCodigoCabcon;

    public ConDetallecontable() {
    }

    public ConDetallecontable(String conCodigoDetcon) {
        this.conCodigoDetcon = conCodigoDetcon;
    }

    public String getConCodigoDetcon() {
        return conCodigoDetcon;
    }

    public void setConCodigoDetcon(String conCodigoDetcon) {
        this.conCodigoDetcon = conCodigoDetcon;
    }

    public Double getConCantidadDetcon() {
        return conCantidadDetcon;
    }

    public void setConCantidadDetcon(Double conCantidadDetcon) {
        this.conCantidadDetcon = conCantidadDetcon;
    }


    

   
    public ConLugarAplicacion getConCodigoLugapl() {
        return conCodigoLugapl;
    }

    public void setConCodigoLugapl(ConLugarAplicacion conCodigoLugapl) {
        this.conCodigoLugapl = conCodigoLugapl;
    }

    public ConCuenta getConCodigoCue() {
        return conCodigoCue;
    }

    public void setConCodigoCue(ConCuenta conCodigoCue) {
        this.conCodigoCue = conCodigoCue;
    }

    public ConCabeceracontable getConCodigoCabcon() {
        return conCodigoCabcon;
    }

    public void setConCodigoCabcon(ConCabeceracontable conCodigoCabcon) {
        this.conCodigoCabcon = conCodigoCabcon;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (conCodigoDetcon != null ? conCodigoDetcon.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConDetallecontable)) {
            return false;
        }
        ConDetallecontable other = (ConDetallecontable) object;
        if ((this.conCodigoDetcon == null && other.conCodigoDetcon != null) || (this.conCodigoDetcon != null && !this.conCodigoDetcon.equals(other.conCodigoDetcon))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pppp.ConDetallecontable[ conCodigoDetcon=" + conCodigoDetcon + " ]";
    }
    
}
